import numpy as np
import gymnasium as gym

class BaseAgent:
    """AI代理基类"""
    
    def __init__(self, action_space):
        self.action_space = action_space
        
    def predict(self, observation):
        """根据观察预测动作"""
        raise NotImplementedError
        
    def learn(self, observation, action, reward, next_observation, done):
        """学习更新策略"""
        raise NotImplementedError
        
    def save(self, path):
        """保存模型"""
        raise NotImplementedError
        
    def load(self, path):
        """加载模型"""
        raise NotImplementedError